#include "trap.h"
#include "inst_test.h"
#include "asm/regdef.h"
#include "asm/asm.h"
    .set noreorder
    .set noat 
    .global main 
    .text 

main:
    ori $t0, $zero, 0x7FFF      # $t0 = 0x7FFF
    lui $t1, 0x8000             # $t1 = 0x80000000
    addu $t2, $t0, $t1          # $t2 = $t0 + $t1
    beq $t0, $t1, skip2         # Branch if $t0 == $t1
    bne $t0, $t1, continue2     # Branch if $t0 != $t1
skip2:
    addiu $t3, $t2, -0xFFFF     # $t3 = $t2 - 0xFFFF
continue2:
    ori $t4, $zero, 0xFF        # $t4 = 0xFF
    andi $t5, $t4, 0x0F         # $t5 = $t4 & 0x0F
    xor $t6, $t5, $t3           # $t6 = $t5 ^ $t3
    blez $t6, end2              # if $t6 <= 0, branch to end2
    add $t7, $t4, $t5           # $t7 = $t4 + $t5
end2:


    HIT_GOOD_TRAP

inst_error:
    HIT_BAD_TRAP